home *** CD-ROM | disk | FTP | other *** search
- CoreAids Macro Assembler Subroutine Library Utilities
- Copyright 1987, CoreTechs
-
- You are free to use, copy and distribute CoreAids providing that:
- NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.
- IT IS NOT MODIFIED IN ANY WAY.
-
- These subroutines are provided AS IS without any warranty,
- expressed or implied, including but not limited to fitness for a
- particular purpose.
-
- Please send comments, suggestions and contributions to:
-
- CoreTechs
- P.O. Box 6207
- Silver Spring, MD 20906
-
- SECTION I. ROUTINES LISTED ALPHABETICALLY
-
- ALOC_CHG.ASM 6/25/87 902
- DESC: Modifies Allocated memory block size V1.00
- IN: *{BLOCK} segment address of memory block to be modified
- *{PARA} new requested block size in paragraphs {ie multiples
- of 16 bytes}
- SAMPLE: Callm ALOC_CHG,<BLOCK,PARA>,
-
- ATRB_WRT.ASM 6/25/87 2268
- DESC: Writes character attributes to the screen V1.00
- IN: *{PAGE} page number (0-3) 4 available pages in 80 column mode
- *{ROWCOL} row(0-24),col(0-79) (ie 0345 indicating fourth row,
- 46th column)
- *{ATRB} attribute (see technical reference manual for
- information on color graphics adapter)
- *{NUM_CHARS} # of chars to be affected
- SAMPLE: Callm ATRB_WRT,<PAGE,ROWCOL,ATRB,NUM_CHARS>,
-
- CHAR_GET.ASM 6/25/87 771
- DESC: gets a character from the keyboard V1.00
- IN: *{REQ_TYPE} (0:get character,1:see if character
- is there,2:get shift status)
- OUT: *{CHAR} character ( high byte is shift status,
- low byte is char.)
- SAMPLE: Callm CHAR_GET,<REQ_TYPE>,<CHAR>
-
- CHG_DIR.ASM 6/25/87 821
- DESC: Changes to a new directory using the path provided V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of path string
- SAMPLE: Callm CHG_DIR,<SEG_VAL,OFFSET>,
-
- CHG_MOD.ASM 6/25/87 1211
- DESC: Changes the mode of a file V1.00
- (ie archived, hidden, system)
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename
- *{FUNC_CODE} function code(1:set mode,0:get mode)
- *{FILE_MODE} mode of file (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file
- OUT: *{CMODE} mode of file after completions of call
- SAMPLE: Callm CHG_MOD,<SEG_VAL,OFFSET,FUNC_CODE,FILE_MODE>,<CMODE>
-
- CLEAR.ASM 6/25/87 524
- DESC: Clears the screen V1.00
- SAMPLE: Callm CLEAR,,
-
- CLOSE.ASM 6/25/87 693
- DESC: Closes a file handle V1.00
- IN: *{INHNDL} handle of file to be closed
- SAMPLE: Callm CLOSE,<INHNDL>,
-
- COPY.ASM 6/25/87 2768
- DESC: Copies existing file to new or existing file V1.00
- using complete path names
- IN: *{OUT_SEG_VAL} segment and
- *{OUT_OFFSET} offset of new filename
- *{IN_SEG_VAL} segment and
- *{IN_OFFSET} offset of old filename
- SAMPLE: Callm COPY,<OUT_SEG_VAL,OUT_OFFSET,IN_SEG_VAL,IN_OFFSET>,
-
- CREATE.ASM 6/25/87 1009
- DESC: Creates a new data file V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename to be created as ASCIIZ string
- *{ATRB} attribute or mode of file as listed in CHG_MOD
- command
- OUT: *{OUTHNDL} handle of file created
- SAMPLE: Callm CREATE,<SEG_VAL,OFFSET,ATRB>,<OUTHNDL>
-
- CURS_GET.ASM 6/25/87 938
- DESC: Gets Cursor Position V1.00
- IN: *{PAGE_NUM} page number (0-7) in 40 character mode
- or (0-3) in 80 character mode (i.e. 0003) is page 4
- OUT: *{ROWCOL} row (0-24),col (0-79) (i.e. 0104)
- 1st row, 5th column
- *{CURS_MODE} cursor mode (see manual for description)
- SAMPLE: Callm CURS_GET,<PAGE_NUM>,<ROWCOL,CURS_MODE>
-
- CURS_SET.ASM 6/25/87 883
- DESC: Sets Cursor Position V1.01
- IN: *{ROWCOL} row and column to postion cursor
- row (0-24),col (0-79) (i.e. 0104)
- 1st row, 5th column
- *{PAGE_NUM} page number (0-7) in 40 character mode and (0-3)
- in 80 character mode (i.e. 0003) is page 4
- SAMPLE: Callm CURS_SET,<ROWCOL,PAGE_NUM>,
-
- DATE_GET.ASM 6/25/87 1482
- DESC: Gets the system date V1.00
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of system date in format MM/DD/YY
- SAMPLE: Callm DATE_GET,<SEG_VAL,OFFSET>,
-
- DELETE.ASM 6/25/87 822
- DESC: Deletes a file V1.00
- IN: *{SEG_VAL} segment
- *{OFFSET} offset of filename to be deleted
- SAMPLE: Callm DELETE,<SEG_VAL,OFFSET>,
-
- ERRORMSG.ASM 6/25/87 5589
- DESC: Prints DOS error messages 1-18 and additional user V1.01
- supplied messages from 19 up. If the value of ERR_NUM is
- 0 control returns to the calling program with no effect.
- If ERR_NUM is greater than the value of the maximum error
- message then the message "No Error for This Value" is
- displayed and control returns to DOS. If an error code is
- displayed then control also returns to DOS. The memory
- address where the error occured is displayed on exit.
- IN: *{ERR_NUM} error number where the possible legal values are:
- 1......Invalid Function Number
- 2......File Not Found
- 3......Path Not Found
- 4......Too Many Open Files (no handles left)
- 5......Access Denied
- 6......Invalid Handle
- 7......Memory Control Blocks Destroyed
- 8......Insufficient Memory
- 9......Invalid Memory Block Address
- 10......Invalid Environment
- 11......Invalid Format
- 12......Invalid Access Code
- 13......Invalid Data
- 14......This Error Does Not Exist
- 15......Invalid Drive Was Specified
- 16......Attempted To Remove The Current Directory
- 17......Not Same Device
- 18......No More Files
- 19......No Room For File(s) On Target Disk
- 20......No Filename(s) Specified
- 21......No Volume Label On Disk
- 22......Wrong Number of Parameters
- >22.....No Error for This Value
- SAMPLE: Callm ERRORMSG,<ERR_NUM>,
-
- EXECUTE.ASM 6/25/87 2336
- DESC: Loads and Executes another program V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename to run including extension
- *{PAR_HI} high word and
- *{PAR_LO} low word of pointer to command line
- to be passed to new program. Command line should be in the
- form N,' ',PARAM,0DH where N is the length of PARAM+1, and is
- followed by a space. PARAM is the command line and 0DH is
- a carriage return ending the line.
- *{MEMBLK} segment value of last memory control block
- segment is typically the value of DS at entry to the main
- program.
- *{SIZE} size of main calling program in segment form
- SAMPLE: Callm EXECUTE,<SEG_VAL,OFFSET,PAR_HI,PAR_LO,MEMBLK,SIZE>,
-
- FILEDATE.ASM 6/25/87 1891
- DESC: Converts Bit-Mapped file date to ASCII format V1.00
- IN : *file date in form yyyyyyymmmmmddddd
- where mm is the month 1-12
- dd is the day 1-31
- yy is the year 0-119 (1980-2099)
- OUT : *segment and
- *offset of the file date in the form
- mm/dd/yy
- SAMPLE: Callm FILEDATE,<DATE>,<ES,BX>
-
- GET_DIR.ASM 6/25/87 1038
- DESC: gets the current directory path string in the form V1.00
- dir1\dir2\dir3...
- IN: *{DRIVE} drive number of the drive to operate on where
- 0 is the default, 1 is A, etc.
- *{SEG_VAL} segment and
- *{OFFSET} offset of 64 byte user are where resultant string
- will be placed ending with a byte containing 0
- SAMPLE: Callm GET_DIR,<DRIVE,SEG_VAL,OFFSET>,
-
- GET_DSK.ASM 6/25/87 679
- DESC: returns the disk transfer address V1.00
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of DTA
- SAMPLE: Callm GET_DSK,,<SEG_VAL,OFFSET>
-
- GET_TEXT.ASM 6/25/87 1333
- DESC: gets a line of text from the keyboard V1.00
- IN: *{MAX_CHARS} maximum # of characters to get from keyboard
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of text buffer
- *{LENGTH} length of text
- SAMPLE: Callm GET_CHAR,<MAX_CHARS>,<SEG_VAL,OFFSET,LENGTH>
-
- HELP.ASM 6/25/87 3269
- DESC: Provides help to the user for all programs V1.03
- linking to the help module and following the
- specified format
- IN: *{DS} value passed to data segment at start of main program
- *{HELP} location of help data
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of parameter string
- *{LENGTH} length of parameter string
- SAMPLE: Callm HELP,<DS,HELP>,<SEG_VAL,OFFSET,LENGTH>
-
- HEXDSPLY.ASM 6/25/87 1855
- DESC: Displays hexadecimal codes as ASCII values V1.00
- IN: *{HEX_WORD} hex word (0000 - FFFF)
- OUT: *{ASC_HI} first two characters of result (i.e EF from EFAB)
- *{ASC_LO} second two characters of result (i.e. AB from EFAB)
- SAMPLE: Callm HEXDSPLY,<HEX_WORD>,<ASC_HI,ASC_LO>
-
- HEX_ASC.ASM 6/25/87 3724
- DESC: Convert Hex numbers to decimal in ASCII format V1.03
- IN: *{HI_HEX} High order word of 4 byte hexadecimal number
- *{LO_HEX} Low order word of 4 byte hexadecimal number
- OUT: *{ASC_1} five words from MSB to LSB with leading
- *{ASC_2} zeros stripped
- *{ASC_3}
- *{ASC_4}
- *{ASC_5}
- SAMPLE: Callm HEX_ASC,<HI_HEX,LO_HEX>,
- <ASC_1,ASC_2,ASC_3,ASC_4,ASC_5>
-
- MOVE_BYT.ASM 6/25/87 912
- DESC: Moves a source buffer to a dest. buffer V1.00
- IN: *{SEG_VAL1} segment and
- *{OFFSET1} offset of input buffer
- *{SEG_VAL2} segment and
- *{OFFSET2} offset of output buffer
- *{NUM_CHARS} # of chars to move
- SAMPLE: Callm MOVE_BYT,<SEG_VAL1,OFFSET1,SEG_VAL2,OFFSET2,
- NUM_CHARS>,
-
- MOV_PTR.ASM 6/25/87 1195
- DESC: Moves the file read/write pointer V1.00
- IN: *{METH_VAL} Method value
- (0:ofst,1:ofst+cloc,2:eof+offset)
- *{HANDLE} handle
- *{MSW} most significant word of offset
- *{LSW} least significant word of offset
- OUT: *{OMSW} most significant word of pointer location
- *{OLSW} least significant word of pointer location
- SAMPLE: Callm MOV_PTR,<METH_VAL,HANDLE,MSW,LSW>,<OMSW,OLSW>
-
- OPEN.ASM 6/25/87 967
- DESC: Opens a file V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename as ASCIIZ strng
- *{ACC_CODE} access code of file (0:read,1:write,2:read write)
- OUT: *{HANDLE} handle of file
- SAMPLE: Callm OPEN,<SEG_VAL,OFFSET,ACC_CODE>,<HANDLE>
-
- PARM_BRK.ASM 6/25/87 1843
- DESC: Takes in parameter string retrieved from DOS level V1.00
- and breaks the string into separate elements using
- commas and the end of line as the only breaks.
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of parameter string
- *{LENGTH} length of parameter string
- OUT: *{N} n is the number of sets of segment,offset and length
- groups returned, which indicates the number of total
- parameters passed to the program.
- *{OSEG_VAL,OOFFSET,OLENGTH} repeated N times
- and returned in reverse order (i.e. P3, P2 , P1)
- SAMPLE: Callm PARM_BRK,<SEG_VAL,OFFSET,LENGTH>,
- <N,<OSEG_VAL,OOFFSET,OLENGTH>>
-
- PARM_GET.ASM 6/25/87 1127
- DESC: Gets parameters passed to program from DOS level V1.00
- at DS+80H
- IN: *{DS} value passed to data segment at start of main program
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of parameter string
- *{LENGTH} length of parameter string
- SAMPLE: Callm PARM_GET,<DS>,<SEG_VAL,OFFSET,LENGTH>
-
- POPALL.ASM 6/25/87 1190
- DESC: Pop all registers (SI,DI,BP,ES,DS,DX,CX,BX,AX) V1.00
- SAMPLE: POPALL
-
- PUSHALL.ASM 6/25/87 1277
- DESC: Push all registers (AX,BX,CX,DX,DS,ES,BP,DI,SI) V1.00
- SAMPLE: PUSHALL
-
- READ.ASM 6/25/87 1008
- DESC: Reads data from a file V1.00
- IN: *{HANDLE} handle of file
- *{NUM_BYTES} number of bytes requested to read from file
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer
- OUT: *{NUM_READ} number of bytes actually read
- SAMPLE: Callm READ,<HANDLE,NUM_BYTES,SEG_VAL,OFFSET>,<NUM_READ>
-
- REPLACE.ASM 6/25/87 1640
- DESC: Replaces an occurence of a string with another V1.00
- string
- IN: *{RSTRNG} segment and
- *{ROFF} offset of replacement string (must be same length)
- *{DIR} direction of search (0:forward,1-FFFF:reverse)
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer to search
- *{LENGTH} length of search string
- *{SSTRNG} segment and
- *{OSTRNG} offset of search string
- OUT: *{OSEG} segment and
- *{OOFF} offset of replacement (both zero if not replaced)
- SAMPLE: Callm REPLACE,<RSTRNG,ROFF,DIR,SEG_VAL,OFFSET,LENGTH,
- SSTRNG,OSTRNG>,<OSEG,OOFF>
-
- SCAN_BYT.ASM 6/25/87 2716
- DESC: Scans a source buffer for given characters V1.01
- and returns the character and location of the closest
- matching character
-
- *** SCAN_BYT performs forward and reverse searches. The CLD
- assembler command must be used before calling the procedure
- to perform a forward search. The STD command must be used
- before calling to perform a reverse search. ***
-
- IN: *{MATCH2N} 2nd and additional matches
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer to scan
- *{MATCH1} 1st of N number of possible matching sequences
- *{N} number of matching sequences passed in
- OUT: *{MATCH_VAL} value of matching character
- *{MATCH_LOC} location of offset in match segment where
- matching value was found
- SAMPLE: Callm SCAN_BYT,<MATCH2N,SEG_VAL,OFFSET,MATCH1,N>,
- <MATCH_VAL,MATCH_LOC>
-
- SCRN_RST.ASM 6/25/87 780
- DESC: Restores 16K screen to video memory V1.00
- SAMPLE: SCRN_RST
-
- SCRN_SAV.ASM 6/25/87 834
- DESC: Saves 16K screen from video memory V1.00
- SAMPLE: SCRN_SAV
-
- SCRN_TYP.ASM 6/25/87 899
- DESC: Returns the address of the video memory buffer V1.00
- OUT: *{VIDEO} segment address of start of video memory area
- Useful only with MDA and CGA graphics. B&W area is at B000H
- while color area is at B800H
- SAMPLE: Callm SCRN_TYP,,<VIDEO>
-
- SEARCH.ASM 6/25/87 2078
- DESC: Searches for a string in the indicated buffer V1.02
- IN: *{DIR} direction of search (0:forward,1-FFFF:reverse)
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer to search
- *{LENGTH} length of search string
- *{SSTRNG} segment and
- *{OSTRNG} offset of search string
- OUT: *{OSEG} segment and
- *{OOFF} of search string (both zero if not found)
- SAMPLE: Callm SEARCH,<DIR,SEG_VAL,OFFSET,LENGTH,SSTRNG,OSTRNG>,
- <OSEG,OOFF>
-
- SET_DSK.ASM 6/25/87 681
- DESC: sets the disk transfer address V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of DTA
- SAMPLE: Callm SET_DSK,<SEG_VAL,OFFSET>,
-
- SRCH_FIL.ASM 6/25/87 2791
- DESC: search for the first of a set of matching filenames V1.00
-
- *** CX must be loaded with the appropriate file attribute
- to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file). ***
-
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of search string
- OUT: *{TIME} time file last written
- *{DATE} date file last written
- *{SIZE_LO} low word of file size
- *{SIZE_HI} high word of file size
- *{OUT_SEG} segment and
- *{OUT_OFF} offset of first matching filename
- *{LENGTH} length of filename found, 0 if not found
- SAMPLE: SRCH_FIL,<SEG_VAL,OFFSET>,
- <TIME,DATE,SIZE_LO,SIZE_HI,OUT_SEG,OUT_OFF,LENGTH>
-
- SRCH_NXT.ASM 6/25/87 2791
- DESC: search for the next of a set of matching filenames V1.00
-
- *** CX must be loaded with the appropriate file attribute
- to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file). ***
-
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of search string
- OUT: *{TIME} time file last written
- *{DATE} date file last written
- *{SIZE_LO} low word of file size
- *{SIZE_HI} high word of file size
- *{OUT_SEG} segment and
- *{OUT_OFF} offset of first matching filename
- *{LENGTH} length of filename found, 0 if not found
- SAMPLE: SRCH_NXT,<SEG_VAL,OFFSET>,
- <TIME,DATE,SIZE_LO,SIZE_HI,OUT_SEG,OUT_OFF,LENGTH>
-
- SRCH_PRE.ASM 6/25/87 2440
- DESC: search for the previous file of a set of filenames V1.00
-
- *** CX must be loaded with the appropriate file attribute
- to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file). ***
-
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of search string
- OUT: *{TIME} time file last written
- *{DATE} date file last written
- *{SIZE_LO} low word of file size
- *{SIZE_HI} high word of file size
- *{OUT_SEG} segment and
- *{OUT_OFF} offset of first matching filename
- *{LENGTH} length of filename found, 0 if not found
- SAMPLE: SRCH_PRE,<SEG_VAL,OFFSET>,
- <TIME,DATE,SIZE_LO,SIZE_HI,OUT_SEG,OUT_OFF,LENGTH>
-
- SRCH_VOL.ASM 6/25/87 1483
- DESC: Search for a volume name V1.00
- IN: *{DRIVE} drive number (0:default,1:A,2:B,etc...)
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of volume name
- *{FLAG} has a value of 0 if a volume label is found
- SAMPLE: Callm,<DRIVE>,<SEG_VAL,OFFSET,FLAG>
-
- STK_STOP.ASM 6/25/87 685
- DESC: return from the user stack to the system stack V1.00
- SAMPLE: STK_STOP
-
- STK_STRT.ASM 6/25/87 742
- DESC: start a user stack V1.00
- SAMPLE: STK_STRT
-
- TEXT_RD.ASM 6/25/87 2204
- DESC: Reads text from the screen V1.00
- IN: *{PAGE} page number of screen (0-3)
- *{ROWCOL} row(0-24), col(0-79) (i.e. 0345) at which to
- begin reading from screen
- *{NUM_CHARS} # of chars to read
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of string read
- SAMPLE: Callm TEXT_RD,<PAGE,ROWCOL,NUM_CHARS>,<SEG_VAL,OFFSET>
-
- TEXT_WRT.ASM 6/25/87 3181
- DESC: Writes text to screen V1.02
- IN: *{ATTRIB_PAGE} attribute used to display text (00-FFH),
- page number to write on (0-3)
- *{ROWCOL} row(0-24), col(0-79) row and column to start writing
- at.
- *{SEG_VAL} segment of text and
- *{OFFSET} offset of text
- *{END_OFF} offset end text
- SAMPLE: Callm TEXT_WRT,<PAGE,ROWCOL,SEG_VAL,OFFSET,END_OFF>,
-
- TIME_GET.ASM 6/25/87 1546
- DESC: Gets the system time V1.00
- OUT: *{SEG_VAL} segment address and
- *{OFFSET} offset within segment of time in ASCII printable
- format. Time is in format HH:MM:SS.XX
- SAMPLE: Callm TIME_GET,,<SEG_VAL,OFFSET>
-
- WRITE.ASM 6/25/87 995
- DESC: Writes to a data file V1.00
- IN: *{HANDLE} handle of file
- *{NUM_BYTES} number of bytes to write
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer
- OUT: *{OUT_BYTES} number of bytes actually written
- SAMPLE: Callm WRITE,<HANDLE,NUM_BYTES,SEG_VAL,OFFSET>,<OUT_BYTES>
-
- SECTION II. ROUTINES LISTED BY FUNCTIONAL AREA
-
- BUFFER OPERATIONS
-
- HEXDSPLY.ASM 6/25/87 1855
- DESC: Displays hexadecimal codes as ASCII values V1.00
- IN: *{HEX_WORD} hex word (0000 - FFFF)
- OUT: *{ASC_HI} first two characters of result (i.e EF from EFAB)
- *{ASC_LO} second two characters of result (i.e. AB from EFAB)
- SAMPLE: Callm HEXDSPLY,<HEX_WORD>,<ASC_HI,ASC_LO>
-
- HEX_ASC.ASM 6/25/87 3724
- DESC: Convert Hex numbers to decimal in ASCII format V1.03
- IN: *{HI_HEX} High order word of 4 byte hexadecimal number
- *{LO_HEX} Low order word of 4 byte hexadecimal number
- OUT: *{ASC_1} five words from MSB to LSB with leading
- *{ASC_2} zeros stripped
- *{ASC_3}
- *{ASC_4}
- *{ASC_5}
- SAMPLE: Callm HEX_ASC,<HI_HEX,LO_HEX>,
- <ASC_1,ASC_2,ASC_3,ASC_4,ASC_5>
-
- MOVE_BYT.ASM 6/25/87 912
- DESC: Moves a source buffer to a dest. buffer V1.00
- IN: *{SEG_VAL1} segment and
- *{OFFSET1} offset of input buffer
- *{SEG_VAL2} segment and
- *{OFFSET2} offset of output buffer
- *{NUM_CHARS} # of chars to move
- SAMPLE: Callm MOVE_BYT,<SEG_VAL1,OFFSET1,SEG_VAL2,OFFSET2,
- NUM_CHARS>,
-
- REPLACE.ASM 6/25/87 1640
- DESC: Replaces an occurence of a string with another V1.00
- string
- IN: *{RSTRNG} segment and
- *{ROFF} offset of replacement string (must be same length)
- *{DIR} direction of search (0:forward,1-FFFF:reverse)
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer to search
- *{LENGTH} length of search string
- *{SSTRNG} segment and
- *{OSTRNG} offset of search string
- OUT: *{OSEG} segment and
- *{OOFF} offset of replacement (both zero if not replaced)
- SAMPLE: Callm REPLACE,<RSTRNG,ROFF,DIR,SEG_VAL,OFFSET,LENGTH,
- SSTRNG,OSTRNG>,<OSEG,OOFF>
-
- SCAN_BYT.ASM 6/25/87 2716
- DESC: Scans a source buffer for given characters V1.01
- and returns the character and location of the closest
- matching character
-
- *** SCAN_BYT performs forward and reverse searches. The CLD
- assembler command must be used before calling the procedure
- to perform a forward search. The STD command must be used
- before calling to perform a reverse search. ***
-
- IN: *{MATCH2N} 2nd and additional matches
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer to scan
- *{MATCH1} 1st of N number of possible matching sequences
- *{N} number of matching sequences passed in
- OUT: *{MATCH_VAL} value of matching character
- *{MATCH_LOC} location of offset in match segment where
- matching value was found
- SAMPLE: Callm SCAN_BYT,<MATCH2N,SEG_VAL,OFFSET,MATCH1,N>,
- <MATCH_VAL,MATCH_LOC>
-
- SEARCH.ASM 6/25/87 2078
- DESC: Searches for a string in the indicated buffer V1.02
- IN: *{DIR} direction of search (0:forward,1-FFFF:reverse)
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer to search
- *{LENGTH} length of search string
- *{SSTRNG} segment and
- *{OSTRNG} offset of search string
- OUT: *{OSEG} segment and
- *{OOFF} of search string (both zero if not found)
- SAMPLE: Callm SEARCH,<DIR,SEG_VAL,OFFSET,LENGTH,SSTRNG,OSTRNG>,
- <OSEG,OOFF>
-
- DOS CONTROL
-
- ALOC_CHG.ASM 6/25/87 902
- DESC: Modifies Allocated memory block size V1.00
- IN: *{BLOCK} segment address of memory block to be modified
- *{PARA} new requested block size in paragraphs {ie multiples
- of 16 bytes}
- SAMPLE: Callm ALOC_CHG,<BLOCK,PARA>,
-
- CHG_DIR.ASM 6/25/87 821
- DESC: Changes to a new directory using the path provided V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of path string
- SAMPLE: Callm CHG_DIR,<SEG_VAL,OFFSET>,
-
- EXECUTE.ASM 6/25/87 2336
- DESC: Loads and Executes another program V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename to run including extension
- *{PAR_HI} high word and
- *{PAR_LO} low word of pointer to command line
- to be passed to new program. Command line should be in the
- form N,' ',PARAM,0DH where N is the length of PARAM+1, and is
- followed by a space. PARAM is the command line and 0DH is
- a carriage return ending the line.
- *{MEMBLK} segment value of last memory control block
- segment is typically the value of DS at entry to the main
- program.
- *{SIZE} size of main calling program in segment form
- SAMPLE: Callm EXECUTE,<SEG_VAL,OFFSET,PAR_HI,PAR_LO,MEMBLK,SIZE>,
-
- GET_DIR.ASM 6/25/87 1038
- DESC: gets the current directory path string in the form V1.00
- dir1\dir2\dir3...
- IN: *{DRIVE} drive number of the drive to operate on where
- 0 is the default, 1 is A, etc.
- *{SEG_VAL} segment and
- *{OFFSET} offset of 64 byte user are where resultant string
- will be placed ending with a byte containing 0
- SAMPLE: Callm GET_DIR,<DRIVE,SEG_VAL,OFFSET>,
-
- PARM_BRK.ASM 6/25/87 1843
- DESC: Takes in parameter string retrieved from DOS level V1.00
- and breaks the string into separate elements using
- commas and the end of line as the only breaks.
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of parameter string
- *{LENGTH} length of parameter string
- OUT: *{N} n is the number of sets of segment,offset and length
- groups returned, which indicates the number of total
- parameters passed to the program.
- *{OSEG_VAL,OOFFSET,OLENGTH} repeated N times
- and returned in reverse order (i.e. P3, P2 , P1)
- SAMPLE: Callm PARM_BRK,<SEG_VAL,OFFSET,LENGTH>,
- <N,<OSEG_VAL,OOFFSET,OLENGTH>>
-
- PARM_GET.ASM 6/25/87 1127
- DESC: Gets parameters passed to program from DOS level V1.00
- at DS+80H
- IN: *{DS} value passed to data segment at start of main program
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of parameter string
- *{LENGTH} length of parameter string
- SAMPLE: Callm PARM_GET,<DS>,<SEG_VAL,OFFSET,LENGTH>
-
- POPALL.ASM 6/25/87 1190
- DESC: Pop all registers (SI,DI,BP,ES,DS,DX,CX,BX,AX) V1.00
- SAMPLE: POPALL
-
- PUSHALL.ASM 6/25/87 1277
- DESC: Push all registers (AX,BX,CX,DX,DS,ES,BP,DI,SI) V1.00
- SAMPLE: PUSHALL
-
- SET_DSK.ASM 6/25/87 681
- DESC: sets the disk transfer address V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of DTA
- SAMPLE: Callm SET_DSK,<SEG_VAL,OFFSET>,
-
- STK_STOP.ASM 6/25/87 685
- DESC: return from the user stack to the system stack V1.00
- SAMPLE: STK_STOP
-
- STK_STRT.ASM 6/25/87 742
- DESC: start a user stack V1.00
- SAMPLE: STK_STRT
-
- FILE MANIPULATION
-
- CHG_MOD.ASM 6/25/87 1211
- DESC: Changes the mode of a file V1.00
- (ie archived, hidden, system)
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename
- *{FUNC_CODE} function code(1:set mode,0:get mode)
- *{FILE_MODE} mode of file (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file
- OUT: *{CMODE} mode of file after completions of call
- SAMPLE: Callm CHG_MOD,<SEG_VAL,OFFSET,FUNC_CODE,FILE_MODE>,<CMODE>
-
- CLOSE.ASM 6/25/87 693
- DESC: Closes a file handle V1.00
- IN: *{INHNDL} handle of file to be closed
- SAMPLE: Callm CLOSE,<INHNDL>,
-
- COPY.ASM 6/25/87 2768
- DESC: Copies existing file to new or existing file V1.00
- using complete path names
- IN: *{OUT_SEG_VAL} segment and
- *{OUT_OFFSET} offset of new filename
- *{IN_SEG_VAL} segment and
- *{IN_OFFSET} offset of old filename
- SAMPLE: Callm COPY,<OUT_SEG_VAL,OUT_OFFSET,IN_SEG_VAL,IN_OFFSET>,
-
- CREATE.ASM 6/25/87 1009
- DESC: Creates a new data file V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename to be created as ASCIIZ string
- *{ATRB} attribute or mode of file as listed in CHG_MOD
- command
- OUT: *{OUTHNDL} handle of file created
- SAMPLE: Callm CREATE,<SEG_VAL,OFFSET,ATRB>,<OUTHNDL>
-
- DELETE.ASM 6/25/87 822
- DESC: Deletes a file V1.00
- IN: *{SEG_VAL} segment
- *{OFFSET} offset of filename to be deleted
- SAMPLE: Callm DELETE,<SEG_VAL,OFFSET>,
-
- MOV_PTR.ASM 6/25/87 1195
- DESC: Moves the file read/write pointer V1.00
- IN: *{METH_VAL} Method value
- (0:ofst,1:ofst+cloc,2:eof+offset)
- *{HANDLE} handle
- *{MSW} most significant word of offset
- *{LSW} least significant word of offset
- OUT: *{OMSW} most significant word of pointer location
- *{OLSW} least significant word of pointer location
- SAMPLE: Callm MOV_PTR,<METH_VAL,HANDLE,MSW,LSW>,<OMSW,OLSW>
-
- OPEN.ASM 6/25/87 967
- DESC: Opens a file V1.00
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of filename as ASCIIZ strng
- *{ACC_CODE} access code of file (0:read,1:write,2:read write)
- OUT: *{HANDLE} handle of file
- SAMPLE: Callm OPEN,<SEG_VAL,OFFSET,ACC_CODE>,<HANDLE>
-
- READ.ASM 6/25/87 1008
- DESC: Reads data from a file V1.00
- IN: *{HANDLE} handle of file
- *{NUM_BYTES} number of bytes requested to read from file
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer
- OUT: *{NUM_READ} number of bytes actually read
- SAMPLE: Callm READ,<HANDLE,NUM_BYTES,SEG_VAL,OFFSET>,<NUM_READ>
-
- SRCH_FIL.ASM 6/25/87 2791
- DESC: search for the first of a set of matching filenames V1.00
-
- *** CX must be loaded with the appropriate file attribute
- to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file). ***
-
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of search string
- OUT: *{TIME} time file last written
- *{DATE} date file last written
- *{SIZE_LO} low word of file size
- *{SIZE_HI} high word of file size
- *{OUT_SEG} segment and
- *{OUT_OFF} offset of first matching filename
- *{LENGTH} length of filename found, 0 if not found
- SAMPLE: SRCH_FIL,<SEG_VAL,OFFSET>,
- <TIME,DATE,SIZE_LO,SIZE_HI,OUT_SEG,OUT_OFF,LENGTH>
-
- SRCH_NXT.ASM 6/25/87 2791
- DESC: search for the next of a set of matching filenames V1.00
-
- *** CX must be loaded with the appropriate file attribute
- to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file). ***
-
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of search string
- OUT: *{TIME} time file last written
- *{DATE} date file last written
- *{SIZE_LO} low word of file size
- *{SIZE_HI} high word of file size
- *{OUT_SEG} segment and
- *{OUT_OFF} offset of first matching filename
- *{LENGTH} length of filename found, 0 if not found
- SAMPLE: SRCH_NXT,<SEG_VAL,OFFSET>,
- <TIME,DATE,SIZE_LO,SIZE_HI,OUT_SEG,OUT_OFF,LENGTH>
-
- SRCH_PRE.ASM 6/25/87 2440
- DESC: search for the previous file of a set of filenames V1.00
-
- *** CX must be loaded with the appropriate file attribute
- to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,10H:sub-directory,
- 20H:archived file). ***
-
- IN: *{SEG_VAL} segment and
- *{OFFSET} offset of search string
- OUT: *{TIME} time file last written
- *{DATE} date file last written
- *{SIZE_LO} low word of file size
- *{SIZE_HI} high word of file size
- *{OUT_SEG} segment and
- *{OUT_OFF} offset of first matching filename
- *{LENGTH} length of filename found, 0 if not found
- SAMPLE: SRCH_PRE,<SEG_VAL,OFFSET>,
- <TIME,DATE,SIZE_LO,SIZE_HI,OUT_SEG,OUT_OFF,LENGTH>
-
- SRCH_VOL.ASM 6/25/87 1483
- DESC: Search for a volume name V1.00
- IN: *{DRIVE} drive number (0:default,1:A,2:B,etc...)
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of volume name
- *{FLAG} has a value of 0 if a volume label is found
- SAMPLE: Callm,<DRIVE>,<SEG_VAL,OFFSET,FLAG>
-
- WRITE.ASM 6/25/87 995
- DESC: Writes to a data file V1.00
- IN: *{HANDLE} handle of file
- *{NUM_BYTES} number of bytes to write
- *{SEG_VAL} segment and
- *{OFFSET} offset of buffer
- OUT: *{OUT_BYTES} number of bytes actually written
- SAMPLE: Callm WRITE,<HANDLE,NUM_BYTES,SEG_VAL,OFFSET>,<OUT_BYTES>
-
- I/O ROUTINES
-
- CHAR_GET.ASM 6/25/87 771
- DESC: gets a character from the keyboard V1.00
- IN: *{REQ_TYPE} (0:get character,1:see if character
- is there,2:get shift status)
- OUT: *{CHAR} character ( high byte is shift status,
- low byte is char.)
- SAMPLE: Callm CHAR_GET,<REQ_TYPE>,<CHAR>
-
- GET_TEXT.ASM 6/25/87 1333
- DESC: gets a line of text from the keyboard V1.00
- IN: *{MAX_CHARS} maximum # of characters to get from keyboard
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of text buffer
- *{LENGTH} length of text
- SAMPLE: Callm GET_CHAR,<MAX_CHARS>,<SEG_VAL,OFFSET,LENGTH>
-
- PROGRAM INFORMATION
-
- ERRORMSG.ASM 6/25/87 5589
- DESC: Prints DOS error messages 1-18 and additional user V1.01
- supplied messages from 19 up. If the value of ERR_NUM is
- 0 control returns to the calling program with no effect.
- If ERR_NUM is greater than the value of the maximum error
- message then the message "No Error for This Value" is
- displayed and control returns to DOS. If an error code is
- displayed then control also returns to DOS. The memory
- address where the error occured is displayed on exit.
- IN: *{ERR_NUM} error number where the possible legal values are:
- 1......Invalid Function Number
- 2......File Not Found
- 3......Path Not Found
- 4......Too Many Open Files (no handles left)
- 5......Access Denied
- 6......Invalid Handle
- 7......Memory Control Blocks Destroyed
- 8......Insufficient Memory
- 9......Invalid Memory Block Address
- 10......Invalid Environment
- 11......Invalid Format
- 12......Invalid Access Code
- 13......Invalid Data
- 14......This Error Does Not Exist
- 15......Invalid Drive Was Specified
- 16......Attempted To Remove The Current Directory
- 17......Not Same Device
- 18......No More Files
- 19......No Room For File(s) On Target Disk
- 20......No Filename(s) Specified
- 21......No Volume Label On Disk
- 22......Wrong Number of Parameters
- >22.....No Error for This Value
- SAMPLE: Callm ERRORMSG,<ERR_NUM>,
-
- GET_DSK.ASM 6/25/87 679
- DESC: returns the disk transfer address V1.00
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of DTA
- SAMPLE: Callm GET_DSK,,<SEG_VAL,OFFSET>
-
- SCREEN MANIPULATION
-
- ATRB_WRT.ASM 6/25/87 2268
- DESC: Writes character attributes to the screen V1.00
- IN: *{PAGE} page number (0-3) 4 available pages in 80 column mode
- *{ROWCOL} row(0-24),col(0-79) (ie 0345 indicating fourth row,
- 46th column)
- *{ATRB} attribute (see technical reference manual for
- information on color graphics adapter)
- *{NUM_CHARS} # of chars to be affected
- SAMPLE: Callm ATRB_WRT,<PAGE,ROWCOL,ATRB,NUM_CHARS>,
-
- CLEAR.ASM 6/25/87 524
- DESC: Clears the screen V1.00
- SAMPLE: Callm CLEAR,,
-
- CURS_GET.ASM 6/25/87 938
- DESC: Gets Cursor Position V1.00
- IN: *{PAGE_NUM} page number (0-7) in 40 character mode
- or (0-3) in 80 character mode (i.e. 0003) is page 4
- OUT: *{ROWCOL} row (0-24),col (0-79) (i.e. 0104)
- 1st row, 5th column
- *{CURS_MODE} cursor mode (see manual for description)
- SAMPLE: Callm CURS_GET,<PAGE_NUM>,<ROWCOL,CURS_MODE>
-
- CURS_SET.ASM 6/25/87 883
- DESC: Sets Cursor Position V1.01
- IN: *{ROWCOL} row and column to postion cursor
- row (0-24),col (0-79) (i.e. 0104)
- 1st row, 5th column
- *{PAGE_NUM} page number (0-7) in 40 character mode and (0-3)
- in 80 character mode (i.e. 0003) is page 4
- SAMPLE: Callm CURS_SET,<ROWCOL,PAGE_NUM>,
-
- SCRN_RST.ASM 6/25/87 780
- DESC: Restores 16K screen to video memory V1.00
- SAMPLE: SCRN_RST
-
- SCRN_SAV.ASM 6/25/87 834
- DESC: Saves 16K screen from video memory V1.00
- SAMPLE: SCRN_SAV
-
- SCRN_TYP.ASM 6/25/87 899
- DESC: Returns the address of the video memory buffer V1.00
- OUT: *{VIDEO} segment address of start of video memory area
- Useful only with MDA and CGA graphics. B&W area is at B000H
- while color area is at B800H
- SAMPLE: Callm SCRN_TYP,,<VIDEO>
-
- TEXT_RD.ASM 6/25/87 2204
- DESC: Reads text from the screen V1.00
- IN: *{PAGE} page number of screen (0-3)
- *{ROWCOL} row(0-24), col(0-79) (i.e. 0345) at which to
- begin reading from screen
- *{NUM_CHARS} # of chars to read
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of string read
- SAMPLE: Callm TEXT_RD,<PAGE,ROWCOL,NUM_CHARS>,<SEG_VAL,OFFSET>
-
- TEXT_WRT.ASM 6/25/87 3181
- DESC: Writes text to screen V1.02
- IN: *{ATTRIB_PAGE} attribute used to display text (00-FFH),
- page number to write on (0-3)
- *{ROWCOL} row(0-24), col(0-79) row and column to start writing
- at.
- *{SEG_VAL} segment of text and
- *{OFFSET} offset of text
- *{END_OFF} offset end text
- SAMPLE: Callm TEXT_WRT,<PAGE,ROWCOL,SEG_VAL,OFFSET,END_OFF>,
-
- SYSTEM INFORMATION
-
- DATE_GET.ASM 6/25/87 1482
- DESC: Gets the system date V1.00
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of system date in format MM/DD/YY
- SAMPLE: Callm DATE_GET,<SEG_VAL,OFFSET>,
-
- FILEDATE.ASM 6/25/87 1891
- DESC: Converts Bit-Mapped file date to ASCII format V1.00
- IN : *file date in form yyyyyyymmmmmddddd
- where mm is the month 1-12
- dd is the day 1-31
- yy is the year 0-119 (1980-2099)
- OUT : *segment and
- *offset of the file date in the form
- mm/dd/yy
- SAMPLE: Callm FILEDATE,<DATE>,<ES,BX>
-
- HELP.ASM 6/25/87 3269
- DESC: Provides help to the user for all programs V1.03
- linking to the help module and following the
- specified format
- IN: *{DS} value passed to data segment at start of main program
- *{HELP} location of help data
- OUT: *{SEG_VAL} segment and
- *{OFFSET} offset of parameter string
- *{LENGTH} length of parameter string
- SAMPLE: Callm HELP,<DS,HELP>,<SEG_VAL,OFFSET,LENGTH>
-
- TIME_GET.ASM 6/25/87 1546
- DESC: Gets the system time V1.00
- OUT: *{SEG_VAL} segment address and
- *{OFFSET} offset within segment of time in ASCII printable
- format. Time is in format HH:MM:SS.XX
- SAMPLE: Callm TIME_GET,,<SEG_VAL,OFFSET>